package cn.gok.homework7;
//定义类Book:int bid,String name,float price
//        除了 全参数构造外，还包含 public void sell(){ //显示本书被卖了}
//private  void sell(float price,String person)://显示本书卖给了xxx，卖了 xxx元
public class Book {
    private int bid;
    private String name;
    private float price;

    public Book(int bid, String name, float price) {
        this.bid = bid;
        this.name = name;
        this.price = price;
    }

    public int getBid() {
        return bid;
    }

    public void setBid(int bid) {
        this.bid = bid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }
    public void sell(){
        System.out.println(this.getName()+"被卖了");
    }
    private  void sell(float price,String person){
        System.out.println(this.getName()+"卖给了"+person+"买了"+price+"元");
    }

    @Override
    public String toString() {
        return "Book{" +
                "bid=" + bid +
                ", name='" + name + '\'' +
                ", price=" + price +
                '}';
    }
}
